package array;

public class ArrayDemo02 {
    public static void main(String[] args) {
        int[] arrays = {1,2,3,4,5};
        int[] reverseArrays = reverseArray(arrays);
        for (int x : reverseArrays) {
            System.out.println(x);
        }
    }

    public static int[] reverseArray(int[] arrays1){
        int[] reverseArrays = new int[arrays1.length];
        for (int i = 0; i < arrays1.length; i++) {
            reverseArrays[i] = arrays1[arrays1.length-1-i];
        }
        return reverseArrays;
    }
}
